package cn.bluemobi.dylan.step.ui;

import android.content.Intent;
import android.widget.TextView;

import butterknife.BindView;
import butterknife.ButterKnife;
import cn.bluemobi.dylan.step.R;
import cn.bluemobi.dylan.step.base.BaseMvpActivity;
import cn.bluemobi.dylan.step.presenter.WelcomePresenter;
import cn.bluemobi.dylan.step.presenter.contract.WelcomeContract;
import cn.bluemobi.dylan.step.ui.login.LoginActivity;

public class WelcomeActivity extends BaseMvpActivity<WelcomePresenter> implements WelcomeContract.View {

    @BindView(R.id.app_version)
    TextView tvVersion;

    @Override
    protected int getLayout() {
        return R.layout.welcome;
    }

    @Override
    protected void initView() {
        super.initView();
        if (!isTaskRoot()) {
            finish();
            return;
        }
        ButterKnife.bind(this);
        tvVersion.setText("Version:V1");
        mPresenter.getWelcomeData();
    }

    @Override
    protected void initInject() {
        getActivityComponent().inject(this);
    }

    @Override
    public void jumpToMain() {
        startActivity(new Intent().setClass(this, TabMainActivity.class));
        finish();
    }

    @Override
    public void jumpToLogin() {
        startActivity(new Intent().setClass(this, LoginActivity.class));
        finish();
    }

    @Override
    public void showError(String msg) {

    }

    @Override
    public void showDialog() {

    }

    @Override
    public void closeDialog() {

    }
}
